﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo7
{
    class Program
    {
        static void Main(string[] args)
        {
            var str = "Hello Kitty!";
            // Substring(起始位，子串长度)取子字符串的方法   
            var substr1 = str.Substring(0, 5);
            var substr2 = str.Substring(6, 5);
            Console.WriteLine($"{str}的前5位子串为{substr1},取第6位开始长度为5的子串{substr2}");
            Console.ReadKey();
        }
    }
}
